//#include <string.h>
#include <jni.h>
#include <android/log.h>
#include <stdio.h>
#include <stdlib.h>
#include "com_test_testcrash_TestJni.h"

#define LOG_TAG "crashcollect"
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG,   __VA_ARGS__)

////////////////////////////////////////////////
int crashByDivideZero(){
    LOGD("crashByDivideZero");
    int a = 1;
    int b = 0;
    int c = a/b;
    return  c;
}

JNIEXPORT jstring JNICALL
Java_com_test_testcrash_TestJni_makeCrash(JNIEnv *env, jclass type) {

    LOGD("Java_com_test_testcrash_TestJni_makeCrash");
    int c = crashByDivideZero();
    char * s;
    s[0]='a';
    return env->NewStringUTF("Hello from JNI !  Compiled with ABI ");
}